Data Structure


Q111.

The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a binary tree of height h is:
GateOverflow

Q112.

The maximum number of binary trees that can be formed with three unlabeled nodes is:
GateOverflow

Q113.

An array X of n distinct integers is interpreted as a complete binary tree. The index of the first element of the array is 0. If only the root node does not satisfy the heap property, the algorithm to convert the complete binary tree into a heap has the best asymptotic time complexity of
GateOverflow

Q114.

An array X of n distinct integers is interpreted as a complete binary tree. The index of the first element of the array is 0. The index of the parent of elementX[i], i \neq 0, is?
GateOverflow

Q115.

In a binary tree, the number of internal nodes of degree 1 is 5, and the number of internal nodes of degree 2 is 10. The number of leaf nodes in the binary tree is
GateOverflow

Q116.

An array X of n distinct integers is interpreted as a complete binary tree. The index of the first element of the array is 0. If the root node is at level 0, the level of element X[i], i \neq 0, is
GateOverflow

Q117.

A scheme for storing binary trees in an array X is as follows. Indexing of X starts at 1 instead of 0. The roots is stored at X[1]. For a node stored at X[i], the left child, if any, is stored in X[2i] and the right child, if any, in X[2i + 1]. To be able to store any binary tree on n vertices, the minimum size of X should be
GateOverflow

Q118.

In a binary tree, for every node the difference between the number of nodes in the left and right subtrees is at most 2. If the height of the tree is h > 0, then the minimum number of nodes in the tree is
GateOverflow

Q119.

Which one of the following binary trees has its inorder and preorder traversals as BCAD and ABCD, respectively?
GateOverflow

Q120.

Level order traversal of a rooted tree can be done by starting from the root and performing
GateOverflow